﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApplication10.App_Code;

namespace WebApplication10
{
    public partial class MasterCreateJob : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Job id = new Job();

            id.Title = txtTitle.Text;
            id.CompanyID = Convert.ToInt32(CompanyID.Text);
            id.CompanyName = CompanyName.Text;
            id.Description = Description.Text;
            id.HighestQualification = HighestQualification.Text;
            id.YearsOfWorkExperience = Convert.ToInt32(YearsOfWorkExperience.Text);
            id.Category = Category.SelectedValue.ToString();
            id.MonthOfPost = Convert.ToInt32(TextBox2.Text);
            id.YearOfPost = Convert.ToInt32(TextBox3.Text);
            id.DateOfPost = Convert.ToInt32(TextBox1.Text);

            int JobID = Job.InsertJob(id);
           // JobCategory.InsertJobCate(JobID, CompanyName.Text, Convert.ToInt32(CompanyID.Text));
            Response.Redirect("MasterCreateJobSuccess.aspx?id=" + id);
            
            
        }

        protected void Category_SelectedIndexChanged(object sender, EventArgs e)
        {
            
            //List<JobCategory> list = JobCategory.GetJobCategories();
           // Category.DataSource = list;
            //Category.DataValueField = "JobCategoryID";
            //Category.DataTextField = "Name";
            //Category.DataBind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
        
        }
    }
}